package com.atguigu.ssyx.product.mapper;

import com.atguigu.ssyx.model.product.SkuInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

/**
 * <p>
 * sku信息 Mapper 接口
 * </p>
 *
 * @author author
 * @since 2024-06-23
 */
@Repository
public interface SkuInfoMapper extends BaseMapper<SkuInfo> {
    //解锁
    void unlockStock(@Param(value = "skuId") Long skuId, @Param(value = "skuNum") Integer skuNum);

    //检查库存
    SkuInfo checkStock(@Param(value = "skuId") Long skuId, @Param(value = "skuNum") Integer skuNum);

    //上锁
    Integer lockStock(@Param(value = "skuId") Long skuId, @Param(value = "skuNum") Integer skuNum);
}
